$(document).ready(function () {
    var msg = document.getElementById("msg");
    var msgLayer = document.getElementById("msgLayer");
    $putIcon = $("#put");
    // $putIcon.click(function () {
    //     alert("发布成功！");
    // })
    var pl = document.getElementById("pl");
    var pl_box = document.getElementById("pl_box");
    msg.onclick = function () {
        if (msgLayer.style.display == "none") { //一定要注意是==
            msgLayer.style.display = "block";
        }
        else {
            msgLayer.style.display = "none";
        }
    }
    pl.onclick = function () {
        if (pl_box.style.display == "none") {
            pl_box.style.display = "block";
        }
        else {
            pl_box.style.display = "none";
        }
        // console.log("闫铭畅是猪！！");
    }
    $("#good").click(function () {
        // $("#good").text()=$("#good").text()++;
        var m = $("#good").text();
        m++;
        $("#good").text(m);
    })
    $(function () {
        $(window).scroll(function () {
            var scrollTop = $(document).scrollTop();
            if (scrollTop <= 531) {
                $("#hot_so").css({ "position": "relative" });
            }
            else {
                $("#hot_so").css({ "right": "0", "position": "fixed" });
                // console.log("麦旋风");
            }
        })
    })

    $.ajax({
        type: "GET",
        url: "http://120.78.87.135:8000/blog/",
        datatype: 'JSON',
        data: {
            // name: "123"
        },
        success: function (data) {
            console.log(data);
            $('#author').html(data[0].blog_author);
        },
        error: function (err) {
            console.log(err.statusText);
            console.log('异常');
        }
    })
})

